Using DXL to Copy across Modules

I have been working on a script which is comparing two modules which are linked to each other to correlating objects. I am currently trying to have the script copy an object from one module to another.

I have tried using the copyFlat, copyHier with the pasteSame command, but this seems to only copy within a module. When i try to paste into a seperate module the script completes, but no paste is made; almost as if there was nothing avaiable to paste. When I try pasting in the same module as it was copied from however the operation happens fine. I noticed that the built in copy and paste functions operate the same way through the edit menu; however, you can click and drag an object to a new module and copy fine that way. I cannot find an equivalent command for this in the dxl reference manual.

Anybody know if there is a command for this?

This is the part of the script I am having difficulties with:

Module m
Module Mm
object o
object Mo
m = current

for o in m do{
ONumber = number(o)
copyFlat
Mm = edit(ModName, false)
current = Mm
set(attribute "Object Number" == ONumber)
refresh Mm
Mo = current
pasteSame
}
Any Idea's, or is there jusy no command for copying objects across modules?

Jonathon Mooney
SystemAdmin - Thu Sep 17 15:50:14 EDT 2009

Re: Using DXL to Copy across Modules
dpechacek - Thu Sep 17 16:36:58 EDT 2009

You cannot copy an object from one module to another. You must create a new object and then copy its data. Just run through the attribute definitions and copy the data for each one that exists in the target module which the current user has the ability to write to.

AAI Services, Textron
dpechacek@aai.textron.com
David.Pechacek@gmail.com

Re: Using DXL to Copy across Modules
ePiallat - Fri Sep 18 08:16:17 EDT 2009

You may use the "copy object" menu entry as an example. Source code is provided in standard DOORS intallation here:

/DOORS/lib/dxl/example/copyobj.dxl

Re: Using DXL to Copy across Modules
mwilliamson - Sat Sep 19 09:48:51 EDT 2009

ePiallat - Fri Sep 18 08:16:17 EDT 2009
You may use the "copy object" menu entry as an example. Source code is provided in standard DOORS intallation here:

/DOORS/lib/dxl/example/copyobj.dxl

Another approach is to copy objects from source module to skip list and then to new module.

Mark